#include "spdlog/sinks/rotating_file_sink.h" // Include the correct header file
#include "spdlog/spdlog.h"
#include <string>

//多个logger输出到一个sink中
//可以写一个logmanger来管理这些logger
//可以参考loggerManger类
void multi_logger_test() {
  auto sharedFileSink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(
      "logs/multi_logger.txt", 1048576 * 10, 3);
  auto firstLogger =
      std::make_shared<spdlog::logger>("firstLogger", sharedFileSink);
  auto secondLogger =
      std::make_shared<spdlog::logger>("secondLogger", sharedFileSink);

  for (int i = 0; i < 10; i++) {
    firstLogger->info("[loggerOne]: Hello {}.", i);
  }

  for (int j = 0; j < 10; j++) {
    secondLogger->info("[loggerTwo]: Hello {}. ", j);
  }
}
int main() {
  multi_logger_test();
  return 0;
}